package com.ncr.travel.appmgr.service.model;

import java.util.List;

import com.ncr.travel.appmgr.model.shared.Function;
import com.ncr.travel.appmgr.model.shared.Graphics;
import com.ncr.travel.appmgr.model.shared.Rule;
import com.ncr.travel.appmgr.model.shared.Text;

/**
 * @author ng185038
 * 
 */
public class ScreenConfiguration {

	private Integer id;
	private String key;
	private String name;
	private String url;
	private List<Text> text;
	private List<Graphics> graphics;
	private List<Function> functions;
	private List<Rule> rules;

	public ScreenConfiguration() {
		super();
	}

	public ScreenConfiguration(Integer id, String name, String url) {
		super();
		this.id = id;
		this.name = name;
		this.url = url;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public final String getKey() {
		return key;
	}

	public final void setKey(String key) {
		this.key = key;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public List<Text> getText() {
		return text;
	}

	public void setText(List<Text> text) {
		this.text = text;
	}

	public List<Rule> getRules() {
		return rules;
	}

	public void setRules(List<Rule> rules) {
		this.rules = rules;
	}

	public List<Graphics> getGraphics() {
		return graphics;
	}

	public void setGraphics(List<Graphics> graphics) {
		this.graphics = graphics;
	}

	public List<Function> getFunctions() {
		return functions;
	}

	public void setFunctions(List<Function> functions) {
		this.functions = functions;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((functions == null) ? 0 : functions.hashCode());
		result = prime * result + ((graphics == null) ? 0 : graphics.hashCode());
		result = prime * result + ((key == null) ? 0 : key.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((rules == null) ? 0 : rules.hashCode());
		result = prime * result + ((text == null) ? 0 : text.hashCode());
		result = prime * result + ((url == null) ? 0 : url.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ScreenConfiguration other = (ScreenConfiguration) obj;
		if (functions == null) {
			if (other.functions != null)
				return false;
		} else if (!functions.equals(other.functions))
			return false;
		if (graphics == null) {
			if (other.graphics != null)
				return false;
		} else if (!graphics.equals(other.graphics))
			return false;
		if (key == null) {
			if (other.key != null)
				return false;
		} else if (!key.equals(other.key))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (rules == null) {
			if (other.rules != null)
				return false;
		} else if (!rules.equals(other.rules))
			return false;
		if (text == null) {
			if (other.text != null)
				return false;
		} else if (!text.equals(other.text))
			return false;
		if (url == null) {
			if (other.url != null)
				return false;
		} else if (!url.equals(other.url))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "ScreenConfiguration [id=" + id + ", key=" + key + ", name=" + name + ", url=" + url + ", text=" + text + ", graphics=" + graphics + ", functions=" + functions + ", rules=" + rules + "]";
	}

}
